package com.park.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.park.dao.IntegralRuleMapper;
import com.park.model.IntegralRecord;
import com.park.model.IntegralRecordWeb;
import com.park.model.IntegralRule;
import com.park.service.IntegralRuleService;

@Service
public class IntegralRuleServiceImpl implements IntegralRuleService {

	@Autowired
	private IntegralRuleMapper integralRuleMapper;
	@Override
	public int insert(IntegralRule integralRule) {
		// TODO Auto-generated method stub
		return integralRuleMapper.insert(integralRule);
	}
	@Override
	public List<IntegralRule> selectIntegralRule(IntegralRecordWeb integralRecordWeb) {
		// TODO Auto-generated method stub
		integralRecordWeb.setStartPage((integralRecordWeb.getStartPage()-1)*integralRecordWeb.getPageSize());
		return integralRuleMapper.selectIntegralRule(integralRecordWeb);
	}
	@Override
	public int selectAllCount(IntegralRecordWeb integralRecordWeb) {
		// TODO Auto-generated method stub
		return integralRuleMapper.selectAllCount(integralRecordWeb);
	}

}
